import { useCallback, useEffect } from 'react';
import '@/assets/styles/global.scss';
import Addform from './Addform';
import { request } from '@/store/modules/doctor';
import { useDispatch } from 'react-redux';
import type { StoreDispatch } from '@/store';

export default function DoctorAdd() {
    // 获取仓库状态
    const dispatch: StoreDispatch = useDispatch();

    const getTabData = useCallback(async () => {
        await dispatch(request());
    }, [dispatch]);

    useEffect(() => {
        getTabData();
    }, [getTabData]);

    return (
        <>
            <div className="header">
                <div className="div1">
                    <div className="icon"></div>
                    <span>新增医生信息</span>
                </div>

                <div className="div2"></div>
            </div>
            <Addform getTabData={getTabData}/>
        </>
    );
}
